package cn.itsource.zcn.pet.service.impl;

import cn.itsource.zcn.pet.domain.PetDetail;
import cn.itsource.zcn.pet.mapper.PetDetailMapper;
import cn.itsource.zcn.pet.service.IPetDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;

/**
 * (PetDetail)表服务实现类
 *
 * @author makejava
 * @since 2021-08-23 19:33:23
 */
@Service
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class PetDetailServiceImpl implements IPetDetailService {
    @Autowired
    private PetDetailMapper tPetDetailMapper;


    /**
     * 新增数据
     *
     * @param tPetDetail 实例对象
     */
    @Override
    @Transactional
    public void save(PetDetail tPetDetail) {
        tPetDetailMapper.save(tPetDetail);
    }

    /**
     * 修改数据
     *
     * @param tPetDetail 实例对象
     */
    @Override
    @Transactional
    public void update(PetDetail tPetDetail) {
        tPetDetailMapper.update(tPetDetail);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     */
    @Override
    @Transactional
    public void delete(Long id) {
        tPetDetailMapper.delete(id);
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PetDetail queryById(Long id) {
        return tPetDetailMapper.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @return 对象列表
     */
    @Override
    public List<PetDetail> queryAll() {
        return tPetDetailMapper.queryAll();
    }


}
